package com.loper7.base.utils.loadsir;

import android.content.Context;
import android.view.View;

import com.kingja.loadsir.callback.Callback;
import com.loper7.base.R;
import com.loper7.base.widget.Shimmer.ShimmerFrameLayout;

public class PlaceholderDetailsCallback extends Callback {
    ShimmerFrameLayout shimmerFrameLayout;

    @Override
    protected int onCreateView() {
        return R.layout.view_placeholder_details;
    }

    @Override
    public void onAttach(Context context, View view) {
        super.onAttach(context, view);
        shimmerFrameLayout = view.findViewById(R.id.shimmer_view_container);
        //开启微光动画
        shimmerFrameLayout.startShimmer();
    }

    @Override
    public void onDetach() {
        super.onDetach();
        shimmerFrameLayout.stopShimmer();
    }

    @Override
    protected boolean onReloadEvent(Context context, View view) {
        return true;
    }
}
